//
//  main.cpp
//  P1059.
//
//  Created by 洋犀利 on 2019/8/31.
//  Copyright © 2019 洋犀利. All rights reserved.
//

#include <iostream>
using namespace std;
int many;
int rans[101]={0};
int real[101]={0};
int head=1;
int realNumeber;
int newHead;
int arrayH;
int dif;

int main(int argc, const char * argv[]) {
    for(int i=0;i<101;i++){
        rans[i] = -1;
        real[i] = -1;
    }
    
    cin>>many;
    for(int i=0;i<many;i++){
        cin>>rans[i];
    }
    for(int i=0;i<many;i++){
        for(int j=head;j<many;j++){
            if(rans[i]==rans[j]){
                rans[j]=-1;
            }
        }
        head++;
    }
    for(int i=0;i<many;i++){
        if(rans[i]!=-1){
            real[newHead] = rans[i];
            newHead++;
            dif++;
        }
    }
    int t=0;
    cout<<dif<<endl;
    //排序开始
    for(int i=0;i<dif;i++){
        for(int j=arrayH;j<dif;j++){
            if(real[i]>real[j]){
                t=real[i];
                real[i]=real[j];
                real[j] =t;
            }
        }
        arrayH++;
    }
    for(int i=0;i<dif;i++){
        cout<<real[i]<<" ";
    }
    
    return 0;
}
